home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / CSMP Digests / csmp-v1-008.txt < prev    next >
Encoding:
Text File  |  1992-11-18  |  51.5 KB  |  1,451 lines  |  [TEXT/MPS ]

  1. C.S.M.P. Digest             Sun, 08 Mar 92       Volume 1 : Issue 8
  2.  
  3. Today's Topics:
  4.  
  5.     Resource Editor for Balloon Help
  6.     MPW C 3.2 usaes an undocumented instruction...
  7.     CopyBits compile time error, Tech Note 41...
  8.     Syntax error in OOPS.h
  9.     Highlighting a text selection
  10.     Sound Driver vs. Sound Manager
  11.     What happen to the GNU C compiler for MPW?
  12.     Mac Applications programming
  13.     Think C v5 and Capps' libraries
  14.     Logo for the Mac?
  15.     Mac Programming Primer Update for Think C 5.0
  16.     pascal source to look at
  17.     Need routine to convert from double to extended.
  18.     BinHex 4.0
  19.     Traps question
  20.  
  21.  
  22. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  23.  
  24. These digests are available (by using FTP, account anonymous, your email
  25. address as password) in the pub/mac directory on ftp.cs.uoregon.edu.
  26. This is also the home of the comp.sys.mac.programmer Frequently Asked
  27. Questions list.
  28.  
  29. The articles in these digests are taken directly from comp.sys.mac.programmer.
  30. They are not edited; all articles included in this digest are in their original
  31. posted form.  The only articles that are -not- included in these digests are
  32. those which didn't receive any replies (except those that give information
  33. rather than ask a question).  All replies to each article are concatenated
  34. onto the original article in the order in which they were received.  Article
  35. threads are not added to the digests until the last article added to the
  36. thread is at least one month old (this is to ensure that the thread is dead
  37. before adding it to the digests).
  38.  
  39. Send administrative mail to mkelly@cs.uoregon.edu.
  40.  
  41. -------------------------------------------------------
  42.  
  43. From: weinstoc@sei.cmu.edu (Chuck Weinstock)
  44. Subject: Resource Editor for Balloon Help
  45. Date: 4 Feb 92 15:13:05 GMT
  46. Organization: The Software Engineering Institute
  47.  
  48.  
  49. Is there a resource editor for balloon help?  If not how do you add
  50. the various balloon help resources to your resource fork?  I tried
  51. running the example from IM through RMaker and it gets an error.
  52.  
  53. Thanks.
  54.  
  55. Chuck Weinstock
  56.  
  57.  
  58. Chuck Weinstock                weinstock@sei.cmu.edu
  59. Software Engineering Institute        (412) 268-7719
  60. Carnegie Mellon University        (412) 268-5758 (Fax)
  61. Pittsburgh, PA 15213
  62.  
  63.  
  64.  
  65. - -------------------------
  66.  
  67. From: rfl@oddjob.uchicago.edu (Bob Loewenstein)
  68. Subject:  Resource Editor for Balloon Help
  69. Date: 4 Feb 92 19:43:25 GMT
  70. Organization: U. of Chicago, Astronomy and Astrophysics
  71.  
  72.  
  73. Check out Resorcerer, available from Mathemaesthetics, Inc.
  74. 1-617-7388803. It supports balloon help, color and styles in dialogs,
  75. and many other nice features not found in ResEdit. There are some
  76. minor problems, but overall, it is worth the money.
  77.  
  78.  
  79.  
  80. ---------------------------
  81.  
  82. From: skelmir@rhi.hi.is (Mimir Reynisson)
  83. Subject: MPW C 3.2 usaes an undocumented instruction...
  84. Date: 1 Feb 92 19:38:45 GMT
  85. Organization: University of Iceland
  86.  
  87. Ok. Ok. I know that sounds like a lot of hassle but so far it is true.
  88. Anyway here is the story uncut and uncensored:
  89.  
  90. I had decided to port over a quite large application from the unix
  91. environment and let it run on a tty console on the Mac (commonly know
  92. as a text window). Apart from problems with SIOW which I later resolved
  93. by replacing it completely, I ran into the following problem when the
  94. program was run under an 68000 machine.
  95.  
  96. An illegal instruction.
  97.  
  98. Now. That is not so unusual so I started on my way to examine my program.
  99. Considering what it could be: maybe I was jumping somewhere illegal, or
  100. maybe there was something wrong with the console, or maybe the program
  101. was simply too large for a Mac SE (because it was compiled with -model far)
  102. but the MPW documentation said that should be a NULL problemos.
  103.  
  104. Ah well ..
  105.  
  106. In the end I actually looked at my TMON screen and what I saw there somewhat
  107. puzzled me. TST.B #0 ??  What a stupid instruction .. Testing a constant??
  108. Hmm... weird .. mind you this is what my Mac II said. After I installed
  109. the new version of TMON on the Mac SE, I saw TST.B #0 as well there.
  110. Hmm .. very weird.. so of I go and look into my Motorola bible and then I
  111. almost had a stroke. Eh? The holy book said there was no such instruction,
  112. no immediate addressing mode for TST.. which I admit makes sense.
  113.  
  114. It was obvious of course that what they wanted to do was set the Z flag
  115. and for some unexplained reason the TST.B #0 had just popped out of the
  116. Twilight zone to do just that.
  117.  
  118. Now everytime I compile the program I have to manually replace all
  119. occurances of TST.B #0 with MOVE.W #4,CCR (which does a bit more but
  120. who cares if I clear the X flag).
  121.  
  122. Ah well  .. life's a bitch and then you have undocumented instructions...
  123.  
  124.  
  125.  
  126. - -------------------------
  127.  
  128. From: dorner@pequod.cso.uiuc.edu (Steve Dorner)
  129. Subject:  MPW C 3.2 usaes an undocumented instruction...
  130. Date: 5 Feb 92 18:21:42 GMT
  131. Organization: University of Illinois at Urbana-Champaign
  132.  
  133. skelmir@rhi.hi.is (Mimir Reynisson) writes:
  134. >Now everytime I compile the program I have to manually replace all
  135. >occurances of TST.B #0 with MOVE.W #4,CCR (which does a bit more but
  136. >who cares if I clear the X flag).
  137.  
  138. Under what conditions did MPW C generate this TST.B instruction?  What
  139. is the C code doing at the time?
  140. -- 
  141. Steve Dorner, U of Illinois Computing Services Office
  142. Internet: s-dorner@uiuc.edu  UUCP: uunet!uiucuxc!uiuc.edu!s-dorner
  143. Apparently-To: does more harm than good.
  144.  
  145.  
  146.  
  147. - -------------------------
  148.  
  149. From: kaufman@Xenon.Stanford.EDU (Marc T. Kaufman)
  150. Subject:  MPW C 3.2 usaes an undocumented instruction...
  151. Date: 5 Feb 92 21:36:25 GMT
  152. Organization: Computer Science Department, Stanford University.
  153.  
  154. In article <4517@krafla.rhi.hi.is> skelmir@rhi.hi.is (Mimir Reynisson) writes:
  155.  
  156. >An illegal instruction.
  157.  
  158. >In the end I actually looked at my TMON screen and what I saw there somewhat
  159. >puzzled me. TST.B #0 ??  What a stupid instruction .. Testing a constant??
  160. >Hmm... weird .. mind you this is what my Mac II said. After I installed
  161. >the new version of TMON on the Mac SE, I saw TST.B #0 as well there.
  162. >Hmm .. very weird.. so of I go and look into my Motorola bible and then I
  163. >almost had a stroke. Eh? The holy book said there was no such instruction,
  164. >no immediate addressing mode for TST.. which I admit makes sense.
  165.  
  166. What was the Hex?  TST.B #0 should be 4a3c 0000
  167.  
  168. On the 68020, TST.W #0 is legal, and should be 4a7c 0000
  169.  
  170. Marc Kaufman (kaufman@cs.stanford.edu)
  171.  
  172.  
  173.  
  174. - -------------------------
  175.  
  176. From: dorner@pequod.cso.uiuc.edu (Steve Dorner)
  177. Subject:  MPW C 3.2 usaes an undocumented instruction...
  178. Organization: University of Illinois at Urbana-Champaign
  179. Date: Thu, 6 Feb 1992 15:40:31 GMT
  180.  
  181. I wrote:
  182. >Under what conditions did MPW C generate this TST.B instruction?  What
  183. >is the C code doing at the time?
  184.  
  185. I have received a reply in the mail, and the author asked me to post it.
  186.  
  187. Date: Thu, 6 Feb 1992 13:52:30 +0100
  188. To: dorner@pequod.cso.uiuc.edu
  189. From: Christophe Meessen <Meessen@slig.ucl.ac.be>
  190.  
  191. Here is for the X time the explanation discovered while debugging
  192. NewsWatcher which bombs when trying to post or respond to an article
  193. on 68000 Macs.
  194.  
  195. 68030 ignores this unimplemented TST instructions.
  196.  
  197. In fact MPW 3.2 C compiler produces a TST on an immediate value which
  198. Motorola didn't implement.
  199.  
  200. This ivalid instruction is produced when the following logical expression
  201. is encountered:
  202.  
  203.  (<logical expression>) &&
  204.  (<instructions>,<constant value>)
  205.  
  206. The C compiler will try to evaluate these expression and thus will produce
  207. a TST on the <constant value>
  208.  
  209. sample which produce the unimplemented instruction:
  210.  
  211.  
  212. #define true 1
  213.  
  214. main(){
  215.    short i;
  216.  
  217.    if ( (i = 1, true) && ( i == 1));
  218. }
  219.  
  220. The presence of the second logical expression is "needed" otherwise, the C
  221. compiler will optimize and remove the test correctly.
  222.  
  223. The instruction is 'easy to recognize' :
  224.  
  225. 4A xxxxx100            TST #immediate
  226.  
  227. The Patch to NewsWatcher is
  228.  
  229. Replace in resource CODE ID:5 "Lowlevel"
  230. the byte sequence
  231.  
  232.         4ABC 0000 0001 6734
  233. by
  234.         4E71 4E71 4E71 4E71
  235.  
  236.                                            Christophe MEESSEN
  237.  
  238.  
  239.  
  240. -- 
  241. Steve Dorner, U of Illinois Computing Services Office
  242. (He who has done nothing for UIUC students, except harass them.)
  243. Internet: s-dorner@uiuc.edu  UUCP: uunet!uiucuxc!uiuc.edu!s-dorner
  244.  
  245.  
  246.  
  247. - -------------------------
  248.  
  249. From: kaufman@Xenon.Stanford.EDU (Marc T. Kaufman)
  250. Subject:  MPW C 3.2 usaes an undocumented instruction...
  251. Date: 6 Feb 92 16:47:47 GMT
  252. Organization: CS Department, Stanford University, California, USA
  253.  
  254. dorner@pequod.cso.uiuc.edu (Steve Dorner) writes:
  255.  
  256. >I wrote:
  257. ->Under what conditions did MPW C generate this TST.B instruction?  What
  258. ->is the C code doing at the time?
  259.  
  260. >I have received a reply in the mail, and the author asked me to post it.
  261.  
  262. >68030 ignores this unimplemented TST instructions.
  263.  
  264. No, it doesn't.  The 68020 and 68030 allow tst.w #const and tst.l #const
  265. as valid instructions.  The only disallowed instruction is tst.b #const.
  266.  
  267. >In fact MPW 3.2 C compiler produces a TST on an immediate value which
  268. >Motorola didn't implement.
  269.  
  270. on the 68000 it is unimplemented.  If you didn't have the -68020 flag on
  271. when compiling, the compiler probably has the instruction marked as the
  272. wrong class.
  273.  
  274. >This ivalid instruction is produced when the following logical expression
  275. >is encountered:
  276.  
  277. > (<logical expression>) &&
  278. > (<instructions>,<constant value>)
  279.  
  280. >The C compiler will try to evaluate these expression and thus will produce
  281. >a TST on the <constant value>
  282.  
  283. >The instruction is 'easy to recognize' :
  284.  
  285. >4A xxxxx100            TST #immediate
  286.  
  287. >The Patch to NewsWatcher is
  288.  
  289. >Replace in resource CODE ID:5 "Lowlevel"
  290. >the byte sequence
  291.  
  292. >        4ABC 0000 0001 6734
  293.  Note that this is a TST.L #1
  294.  
  295. >by
  296. >        4E71 4E71 4E71 4E71
  297.  
  298. >                                           Christophe MEESSEN
  299.  
  300. -- 
  301. Marc Kaufman (kaufman@CS.Stanford.EDU)
  302.  
  303.  
  304.  
  305. ---------------------------
  306.  
  307. From: mbp@generali.harvard.edu (Mark B Palmerino)
  308. Subject: CopyBits compile time error, Tech Note 41...
  309. Date: 4 Feb 92 17:41:07 GMT
  310. Organization: Harvard University, Cambridge, MA
  311.  
  312. Hi,
  313.  
  314. I'm having a problem with getting CopyBits to work as explained in Tech
  315. Note 41. I seem to be running into a compiler error as C++ gets to the 
  316. actual CopyBits command. I've enclosed below the C++ fragment that
  317. includes the CopyBits call and the error as reported by MPW. 
  318.  
  319. The error is quite cryptic but I was hoping someone might have an idea
  320. of what I'm doing wrong. The error, which is shown in context below, is:
  321.  
  322. ...line 96 # internal << CFront Version 1.0 (9/11/90; AT&T 2.0) )Apple Computer,
  323.  Inc. 1989-90 >> error: check(13194728, 0, 136)
  324.                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  325.  
  326. What does "error: check(13194728, 0, 136)" refer to???
  327.  
  328. Thanks in advance for all your help.
  329.  
  330.  
  331. Boolean TPICTDoc::DrawRSD(Rect *r) {
  332.  
  333.   GrafPtr   offscreen;     /* our off-screen bitmap */
  334.   Rect      ovalRect;      /* used for example drawing */
  335.   Rect      OSRect;       /* portRect and bounds for off-screen bitmap*/
  336.  
  337.   if (!CreateOffscreenBitMap(&offscreen, &fDocWindow->portRect)) {
  338.     SysBeep(1);
  339.     ExitToShell();
  340.     }
  341.  
  342.   /* Example drawing to our off-screen bitmap*/
  343.   SetPort(offscreen);
  344.   OSRect = offscreen->portRect; /* offscreen bitmap's local coordinate rect */
  345.   ovalRect = OSRect;
  346.   FillOval(&ovalRect, qd.black);
  347.   InsetRect(&ovalRect, 1, 20);
  348.   FillOval(&ovalRect, qd.white);
  349.   InsetRect(&ovalRect, 40, 1);
  350.   FillOval(&ovalRect, qd.black);
  351.  
  352.   /* copy from the off-screen bitmap to the on-screen window.  Note that
  353.    in this case the source and destination rects are the same size and
  354.    both cover the entire area.  These rects are allowed to be portions
  355.    of the source and/or destination and do not have to be the same size.
  356.    If they are not the same size then _CopyBits scales the image accordingly.
  357.   */
  358.   SetPort(fDocWindow);
  359.   CopyBits(&offscreen->portBits, &(*fDocWindow).portBits,
  360.            &offscreen->portRect, &(*fDocWindow).portRect, srcCopy, 0L);
  361.  
  362. /*
  363. * Note: fDocWindow is a window that is created by my application
  364. * in the following manner:
  365. Boolean TDoc::MakeWindow(Boolean coloWindow) {
  366.     if (coloWindow)
  367.         fDocWindow = GetNewCWindow(GetWinID(),nil,(WindowPtr) -1);
  368.     else
  369.         fDocWindow = GetNewWindow(GetWinID(),nil,(WindowPtr) -1);
  370.         
  371.     return (fDocWindow != nil);
  372.     
  373. }
  374. *
  375. */
  376.  
  377.  
  378.   DestroyOffscreenBitMap(offscreen);    /* dump the off-screen bitmap */
  379.  
  380.     return true;
  381. }
  382.  
  383. # 12:20:38 PM ----- Build of mmview.
  384. # 12:20:38 PM ----- Analyzing dependencies.
  385. # 12:20:42 PM ----- Executing build commands.
  386.     CPlus ::MMView:draw.cp -o ::MMView:draw.cp.o -sym off -i ... (etc.)
  387.      Set Echo 0
  388. File "::MMView:draw.cp"; line 96 # internal << CFront Version 1.0
  389. (9/11/90; AT&T 2.0) )Apple Computer, Inc. 1989-90 >> 
  390.  
  391. error: check(13194728, 0, 136)
  392.  
  393. ### MPW Shell - Execution of mmview.makeout terminated.
  394. ### MPW Shell - Execution of BuildProgram terminated.
  395.  
  396.  
  397. The error I get is:
  398.     error: check(13194728, 0, 136)
  399.  
  400. What in the world does this mean? What can I do to solve the problem?
  401. Line 96 is the CopyBits command in the above code.
  402.  
  403. Help!
  404. -- 
  405. Mark Palmerino      mbp@wjh12.harvard.edu       Voice: (617) 345-9500
  406.  
  407.  
  408.  
  409. - -------------------------
  410.  
  411. From: ksand@apple.com (Kent Sandvik)
  412. Subject:  CopyBits compile time error, Tech Note 41...
  413. Date: 6 Feb 92 17:59:00 GMT
  414. Organization: MacDTS Mongols
  415.  
  416. In article <1992Feb4.174107.10473@burrhus.harvard.edu>, mbp@generali.harvard.edu (Mark B Palmerino) writes:
  417. >   SetPort(fDocWindow);
  418. >   CopyBits(&offscreen->portBits, &(*fDocWindow).portBits,
  419. >            &offscreen->portRect, &(*fDocWindow).portRect, srcCopy, 0L);
  420.                                                                      ^^  change to O
  421.  
  422. > The error I get is:
  423. >     error: check(13194728, 0, 136)
  424. > What in the world does this mean? What can I do to solve the problem?
  425. > Line 96 is the CopyBits command in the above code.
  426.  
  427. This is the infamous 0L bug that people using MPW C++ encounters now and then.
  428. Change the value to 0 or a constant and it should go away.
  429.  
  430. As for the error message, ask the boys&girls at AT&T why they like cryptic messages :-).
  431.  
  432. Kent Sandvik
  433.  
  434.  
  435.  
  436. ---------------------------
  437.  
  438. From: umduddr0@ccu.umanitoba.ca (Brendan Duddridge)
  439. Subject: Syntax error in OOPS.h
  440. Date: 4 Feb 92 18:43:46 GMT
  441. Organization: University of Manitoba, Winnipeg, Canada
  442.  
  443. I am trying to use Object Oriented Programming in Think C 5.0.1.  However, I
  444. seem to have a syntax error in my oops.h file.  The first line has the syntax
  445. error.  It goes like this:
  446.  
  447.     void *new(void *);
  448.  
  449. And Think C seems to think this is a syntax error.  I am just a beginning C
  450. programmer, so I don't really even know if there's a syntax error here or not.
  451. Can anyone help me with this?
  452.  
  453. Thanx...
  454.  
  455. -- 
  456. Brendan Duddridge
  457. InterNet        : umduddr0@ccu.umanitoba.ca
  458. America Online  : BrendanD1
  459.  
  460.  
  461.  
  462. - -------------------------
  463.  
  464. From: umduddr0@ccu.umanitoba.ca (Brendan Duddridge)
  465. Subject:  Syntax error in OOPS.h
  466. Date: 4 Feb 92 20:49:06 GMT
  467. Organization: University of Manitoba, Winnipeg, Canada
  468.  
  469.  
  470. >I am trying to use Object Oriented Programming in Think C 5.0.1.  However, I
  471.                                        correction -----> C 5.0.2...
  472. >seem to have a syntax error in my oops.h file.  The first line has the syntax
  473. >error.  It goes like this:
  474.  
  475. >    void *new(void *);
  476.  
  477. >And Think C seems to think this is a syntax error.  I am just a beginning C
  478. >programmer, so I don't really even know if there's a syntax error here or not.
  479. >Can anyone help me with this?
  480.  
  481. >Thanx...
  482.  
  483. -- 
  484. Brendan Duddridge
  485. InterNet        : umduddr0@ccu.umanitoba.ca
  486. America Online  : BrendanD1
  487.  
  488.  
  489.  
  490. - -------------------------
  491.  
  492. From: Carl.Constantine@BCSystems.GOV.BC.CA
  493. Subject:  Syntax error in OOPS.h
  494. Date: 6 Feb 92 07:44:50 -0800
  495. Organization: BC Systems Corporation
  496.  
  497. In article <1992Feb4.184346.22204@ccu.umanitoba.ca>, umduddr0@ccu.umanitoba.ca (Brendan Duddridge) writes:
  498. > I am trying to use Object Oriented Programming in Think C 5.0.1.  However, I
  499. > seem to have a syntax error in my oops.h file.  The first line has the syntax
  500. > error.  It goes like this:
  501. >     void *new(void *);
  502. > And Think C seems to think this is a syntax error.  I am just a beginning C
  503. > programmer, so I don't really even know if there's a syntax error here or not.
  504. > Can anyone help me with this?
  505.  
  506. I think (no pun intended) that this "error" was detected and fixed in TCL
  507. 1.1.2.  If you don't have it, get (FTP really) the THINK C 5.0.2 update (with TCL 1.1.2)
  508. from Sumex-aim.stanford.edu [36.44.0.6].
  509.  
  510. --                                                                           
  511. Carl.Constantine@BCSystems.gov.bc.ca
  512. British Columbia, Canada
  513.  
  514.  
  515.  
  516.  
  517. ---------------------------
  518.  
  519. From: brunner@brchh87.bnr.ca (James Brunner)
  520. Subject: Highlighting a text selection
  521. Date: 4 Feb 92 19:43:53 GMT
  522.  
  523. Greetings.  Can anyone tell me how to highlight a selection of text in
  524. the proper text selection color.  In my application, I am not using the
  525. TextEdit facility (I need a very large buffer).  I have drawn text to the
  526. window using DrawText and now, I want to be able to make a selection in
  527. the proper color.  Do I need a color window?  What color do I use?  How
  528. do I change the background without affecting the text?
  529.  
  530. Any suggestions appreciated.  Thanks in advance for your help.
  531. -- 
  532. - -------------------------------------------------------------------------
  533. Jim Brunner - (brunner@brchh87.BNR.CA)
  534. All opinions are my own and have nothing whatsoever to do with BNR, NT,
  535. NTI, Bell Canada, or any of the BCE corporations or affiliates.
  536.  
  537.  
  538.  
  539. - -------------------------
  540.  
  541. From: jcav@quads.uchicago.edu (JohnC)
  542. Subject:  Highlighting a text selection
  543. Date: 4 Feb 92 20:58:42 GMT
  544. Organization: The Royal Society for Putting Things on Top of Other Things
  545.  
  546. In article <6337@brchh104.bnr.ca> brunner@brchh87.bnr.ca (James Brunner) writes:
  547. >Greetings.  Can anyone tell me how to highlight a selection of text in
  548. >the proper text selection color.  In my application, I am not using the
  549. >TextEdit facility (I need a very large buffer).  I have drawn text to the
  550. >window using DrawText and now, I want to be able to make a selection in
  551. >the proper color.  Do I need a color window?  What color do I use?  How
  552. >do I change the background without affecting the text?
  553.  
  554. You're in luck.  There are two methods, both of which will auto-magically
  555. do The Right Thing.  Of course, you do have to be using a color window.
  556. Here is some code:
  557.  
  558. Method 1)
  559.  
  560.  PROCEDURE SetHiliteMode;
  561.  INLINE
  562.   $08B8, $0007, $0938;    { bclr #hiliteBit,HiliteMode }
  563.  
  564.  ForeColor(blackColor);
  565.  BackColor(whiteColor);
  566.  SetHiliteMode;
  567.  InvertRect(box);
  568.  
  569. When the hilite bit in low-memory bit is cleared, the _next_ drawing command
  570. (only), if it is an inverting-type command, will use the user's hilite color
  571. instead of inverting.  Since Quickdraw resets the bit after each drawing
  572. operation, you have to set it up each time you want to hilite.
  573.  
  574.  
  575. Method 2)
  576.  
  577.  ForeColor(blackColor);
  578.  BackColor(whiteColor);
  579.  PenPat(black);
  580.  PenMode(hilite);
  581.  PaintRect(box);
  582.  
  583.  
  584. What both methods do is to cause drawing to exchange the background color
  585. and the hilight color in the destination, but only in the pixels
  586. corresponding to black in the source pattern.
  587.  
  588. All of this is documented in IM 5, p61-62.
  589.  
  590. -- 
  591. John Cavallino                  |  EMail: jcav@midway.uchicago.edu
  592. University of Chicago Hospitals |         John_Cavallino@uchfm.bsd.uchicago.edu
  593. Office of Facilities Management | USMail: 5841 S. Maryland Ave, MC 0953
  594. B0 f++ c+ g+ k s+(+) e+ h- pv   |         Chicago, IL  60637
  595.  
  596.  
  597.  
  598. ---------------------------
  599.  
  600. From: ingemar@isy.liu.se (Ingemar Ragnemalm)
  601. Subject: Sound Driver vs. Sound Manager
  602. Date: 4 Feb 92 09:09:31 GMT
  603. Organization: Dept of EE, University of Linkoping
  604.  
  605.  
  606. How backewards compatible are the Sound Driver routines? Can we still safely
  607. use them?
  608.  
  609. For my sound playing needs, I used Sound Manager for a long time, but it
  610. gave me a lot of problems:
  611.  
  612. - It is hard to use. It takes *lots* of code to do *anything* except playing
  613. a sound synchronously (which is a straight call to SndPlay). Just look at
  614. Apple's SoundApp example. It is *huge*. (I also got lots of crashes for a
  615. while, since I had debug mode on for the sound module, which included a
  616. callback routine.) I've spent hours and hours rewriting my interface to the
  617. Sound Manager.
  618. - I have to break Apple's rules. Apple says that I must dispose my channel
  619. immediately. This gives an unacceptable slowdown on my SE. I want to play
  620. the sounds during animations, and the allocation and disposal of channels
  621. make it jerky. (Yes, I *do* play unsynchronously.)
  622. - If the program quits unexpectedly, the Mac is totally silent until reboot.
  623. This isn't acceptable (or at least very annoying) when developing. Isn't
  624. there any way to kick Sound Manager awake again?
  625.  
  626. Then I got the idea to try the ancient Sound Driver (IM-2). I hacked my
  627. interface in *minutes*. No problems. No callback routines. No jerkyness.
  628. A little fix to get rid of the worst "clicking", but the buffer size rule
  629. in IM-2 still seems to hold. Having the Mac play melodies was also simple.
  630. Sure, square-wave music isn't very impressing, but it takes virtually *no* CPU.
  631.  
  632. I have one question, though: Are there any known *major* problems with the
  633. Sound Driver? Once in a great while, my program unexpectedly quits, and I
  634. get the feeling that it is more common than before. Since it is so rare,
  635. I have no chance to track down the problem. It *might* be Sound Driver.
  636.  
  637. Everyone seems to go for the Sound Manager. Other than going against the
  638. majority, do I give myself some big problems in the future? Right now I'm
  639. saving time by using Sound Driver instead. Any good reasons why I shouldn't?
  640.  
  641. -- 
  642. Ingemar Ragnemalm
  643. Dept. of Electrical Engineering         ...!uunet!mcvax!enea!rainier!ingemar
  644.                   ..
  645. University of Linkoping, Sweden         ingemar@isy.liu.se
  646.  
  647.  
  648.  
  649. - -------------------------
  650.  
  651. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  652. Subject:  Sound Driver vs. Sound Manager
  653. Date: 5 Feb 92 15:38:50 GMT
  654. Organization: Kalamazoo College
  655.  
  656. ingemar@isy.liu.se (Ingemar Ragnemalm) writes:
  657. > [The Sound Manager is...]
  658. >- It is hard to use. It takes *lots* of code to do *anything* except playing
  659. >a sound synchronously (which is a straight call to SndPlay).
  660.  
  661. Not true, not about the code anyway.  You can do a lot with twenty lines
  662. of code.
  663.  
  664. >I've spent hours and hours rewriting my interface to the
  665. >Sound Manager.
  666.  
  667. Now this I won't dispute.  You're not alone in this regard...  :-/
  668.  
  669. >- I have to break Apple's rules. Apple says that I must dispose my channel
  670. >immediately. This gives an unacceptable slowdown on my SE. I want to play
  671. >the sounds during animations, and the allocation and disposal of channels
  672. >make it jerky. (Yes, I *do* play unsynchronously.)
  673.  
  674. Apple recommends immediate channel disposal because an open channel can
  675. prevent the rest of the machine from making sound.  You should dispose
  676. channels whenever you have time.  This does _not_ mean that you have to
  677. remove old channels the instant they're free.  During animation, go
  678. ahead and leave one channel open, and play everything through it.
  679.  
  680. >- If the program quits unexpectedly, the Mac is totally silent until reboot.
  681. >This isn't acceptable (or at least very annoying) when developing. Isn't
  682. >there any way to kick Sound Manager awake again?
  683.  
  684. I understood that this was fixed after system 6.0.5.  What machine are
  685. you on?  Try visiting the Sound control panel and turning the volume
  686. off and back on.
  687.  
  688. >I have one question, though: Are there any known *major* problems with the
  689. >Sound Driver? Once in a great while, my program unexpectedly quits, and I
  690. >get the feeling that it is more common than before. Since it is so rare,
  691. >I have no chance to track down the problem. It *might* be Sound Driver.
  692. >
  693. >Everyone seems to go for the Sound Manager. Other than going against the
  694. >majority, do I give myself some big problems in the future? Right now I'm
  695. >saving time by using Sound Driver instead. Any good reasons why I shouldn't?
  696.  
  697. Please, please, please, please, please don't use the Sound Driver.
  698.  
  699. Ahem.
  700.  
  701. The reason is:  the current Sound Manager has to dedicate a lot of code
  702. to supporting the old Sound Driver.  Every time you use the Sound
  703. Driver on a current system, the 'Manager has to intercept the calls and
  704. go into "compatibility mode," where it does Lord knows what to make the
  705. archaic functions work.  As a side effect, it turns off all sound except
  706. what you're doing.  (Which is the worst thing that will happen if you
  707. leave a channel open anyway...)
  708.  
  709. The good folks up at Apple have a hard enough time writing sound
  710. code that works on every Macintosh as it is.  This backwards
  711. compatibility must be a real drag.  Every hour they spend writing code
  712. to support the old 'Driver is an hour that's taken away from writing
  713. good, solid, useful code for the future.  Someday, they'll make the
  714. decision to abandon compatibility (probably the day after the Talking
  715. Moose is discontinued).  Don't do anything that will postpone that day.
  716.  
  717. Ingemar, I have a lot of sample code that may interest you.  If you (or
  718. anyone else reading) wants it, mail me.
  719. -- 
  720.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  721.  Kzoo randomly kills all my mail;  if I don't acknowledge, try resending.    
  722.  
  723.  
  724.  
  725. - -------------------------
  726.  
  727. From: jmunkki@hila.hut.fi (Juri Munkki)
  728. Subject:  Sound Driver vs. Sound Manager
  729. Date: 5 Feb 92 17:24:04 GMT
  730. Organization: Helsinki University of Technology, Finland
  731.  
  732. In article <ingemar.697194571@isy.liu.se> ingemar@isy.liu.se (Ingemar Ragnemalm) writes:
  733. >How backwards compatible are the Sound Driver routines? Can we still safely
  734. >use them?
  735.  
  736. They still seem to work although at some point Apple promised that the
  737. sound driver would go away with System 7.0.
  738.  
  739. >For my sound playing needs, I used Sound Manager for a long time, but it
  740. >gave me a lot of problems:
  741.  
  742. It seems to give a lot of people problems. I haven't used it much, but
  743. now that IM-VI has documentation that actually makes sense, it is possible
  744. to use it.
  745.  
  746. >- It is hard to use. It takes *lots* of code to do *anything* except playing
  747. >a sound synchronously (which is a straight call to SndPlay).
  748.  
  749. I think Apple tried too hard to make the sound manager do everything. What
  750. we need is a set of managers built on top of the sound manager that will
  751. do simple things that need to be done often. In this respect, the Sound
  752. Driver was very good: it was simple to use and understandable.
  753.  
  754. >- If the program quits unexpectedly, the Mac is totally silent until reboot.
  755. >This isn't acceptable (or at least very annoying) when developing. Isn't
  756. >there any way to kick Sound Manager awake again?
  757.  
  758. You could try patching ExitToShell so that it closes your sound stuff
  759. correctly. That's what I did with the STORM/Arashi sound kit.
  760.  
  761. >I have one question, though: Are there any known *major* problems with the
  762. >Sound Driver? Once in a great while, my program unexpectedly quits, and I
  763. >get the feeling that it is more common than before. Since it is so rare,
  764. >I have no chance to track down the problem. It *might* be Sound Driver.
  765.  
  766. Using the sound driver will cause problems with other applications. If you
  767. know that you are the only application running with the sound driver, you're
  768. safe. If two applications attempt to use the sound driver at the same time,
  769. you're in trouble.
  770.  
  771. >Everyone seems to go for the Sound Manager. Other than going against the
  772. >majority, do I give myself some big problems in the future? Right now I'm
  773. >saving time by using Sound Driver instead. Any good reasons why I shouldn't?
  774.  
  775. As I said, the Sound Driver already causes problems. IMHO, these problems
  776. can be solved by Apple, but Apple doesn't care about the sound driver any
  777. more, since it isn't supported.
  778.  
  779. If you are using a few simple sound effect asynchronously or you want to
  780. play music with just a few different notes (sampled), try the STORM/Arashi
  781. sound kit. The Sound Kit is available from sumex-aim.stanford.edu and it
  782. complies with Think C 5.0. If there's enough demand, I can make a code
  783. resource version of it so that you can use it from any development
  784. environment.
  785.  
  786. The Sound Kit uses the Sound Driver or the Sound Manager depending on how
  787. you set it up. This way you can have either maximum control and speed (with
  788. the sound driver) or maximum compatibility (sound manager). Eiher way,
  789. the programming interface is the same.
  790.  
  791. The Sound Kit is currently limited to two channels of sampled monophonic
  792. sound at 11Khz. I know this is more limiting than the Sound Driver and
  793. much more limiting than the Sound Manager, but it's also much easier to
  794. use than either of these packages and it provides fairly good sound
  795. compression (to save disk space). It's almost ideal for most arcade games.
  796.  
  797.    ____________________________________________________________________________
  798.   / Juri Munkki        /  Helsinki University of Technology   /  Wind  / Project /
  799.  / jmunkki@hut.fi  /  Computing Center Macintosh Support  /  Surf  / Arashi  /
  800.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  801.  
  802.  
  803.  
  804. ---------------------------
  805.  
  806. From: mxmora@unix.SRI.COM (Matt Mora)
  807. Subject: What happen to the GNU C compiler for MPW?
  808. Date: 4 Feb 92 22:10:01 GMT
  809. Organization: SRI International, Menlo Park, CA
  810.  
  811. Where did the GNU C for MPW compiler go? It used to be on ftp.apple.com
  812. I thought, but its no longer there. Where did it go?
  813. Is it still available? Where can I get it?
  814.  
  815. Thanks
  816.  
  817. Matt
  818.  
  819.  
  820. -- 
  821. ___________________________________________________________
  822. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  823. SRI International           |  my unix  mxmora@unix.sri.com
  824. ___________________________________________________________
  825.  
  826.  
  827.  
  828. - -------------------------
  829.  
  830. From: johnston@me.udel.edu (Bill Johnston)
  831. Subject:  What happen to the GNU C compiler for MPW?
  832. Date: 5 Feb 92 02:31:00 GMT
  833. Organization: University of Delaware/Department of Mechanical Engineering
  834.  
  835. In article <31990@unix.SRI.COM>, mxmora@sri-unix.sri.com (Matt Mora) writes...
  836. >Where did the GNU C for MPW compiler go? It used to be on ftp.apple.com
  837. >I thought, but its no longer there. Where did it go?
  838.  
  839. GCC and EMACS for aux are available on ftp.apple.com in /pub/gnu.
  840.  
  841. The MPW version is available on sumex-aim.stanford.edu in /info-mac/lang.
  842.  
  843. -- Bill (johnston@me.udel.edu)
  844.  
  845.  
  846.  
  847. ---------------------------
  848.  
  849. From: jdt@kepler.unh.edu (Jay D Thomas)
  850. Subject: Mac Applications programming
  851. Organization: University of New Hampshire  -  Durham, NH
  852. Date: Wed, 5 Feb 1992 03:49:53 GMT
  853.  
  854.  
  855.  
  856. I am interested in getting into applications programming for the Mac.
  857. I've had some experience programming directly with the toolbox, but
  858. it has not been pleasant.  I know the languages of C and Pascal but just
  859. don't know the standard ways of the Mac to effectively use the toolboox
  860. with the languages.
  861.  
  862. Points of confusion are people mentioning MacApp, MPW, Think C, THINk pascal
  863. I know that thinkc and think pascal are both compatible with MacApp even
  864. though MacApp is a MPW module (object oriented).  Should I buy Think C
  865. and MacApp, or is that not a good combination?  What is the standard 
  866. way that application programming is done on the macintosh?  As I mentioned
  867. before, my toolbox experience was quite hellish because of both the
  868. incompatibility of the language with it and the fact that there are
  869. all these *standard* routines that have to be called in the *right* order.
  870. I would like to know how does one avoid this nightmare... surely
  871. someone has written a *standard* package that will bring this toolbox
  872. up to a higher level (usable!).
  873.  
  874. Another factor here is cost... I can't afford to spend a grand on MPW, Macapp
  875. etc!!! I just want to do some programming on the Mac because I enjoy the
  876. Mac and programming itself.....  Am I out of luck or is there a feasable
  877. solution?
  878.  
  879.             Sincerly,
  880.                 Jay Thomas
  881.  
  882.  
  883.  
  884.  
  885.  
  886. - -------------------------
  887.  
  888. From: orpheus@reed.edu (P. Hawthorne)
  889. Subject:  Mac Applications programming
  890. Organization: Reed College, Portland OR
  891. Date: Thu, 6 Feb 1992 08:31:04 GMT
  892.  
  893.   jdt@kepler.unh.edu (Jay D Thomas) writes:
  894. : I am interested in getting into applications programming for the Mac.
  895. : I've had some experience programming directly with the toolbox, but
  896. : it has not been pleasant.  I know the languages of C and Pascal but just
  897. : don't know the standard ways of the Mac to effectively use the toolboox
  898. : with the languages.
  899.  
  900.     There's the rub. It's not trivial developing Mac applications without
  901. having already become versant in using them. Of course, it's not supposed
  902. to be the other way around.
  903.     Mac applications are supposed to be very much a cross between like your
  904. mother's worst nightmare and the ideal date in that they are supposed to be
  905. easy, reliable, responsive, and megadeep. Fast and sweet never hurt either.
  906.  
  907.     This may be somewhat controversial, because you really probably want to
  908. be told what development environment to buy, but if time permits, you
  909. should use a bunch of good Mac apps to do some hard things first.
  910.     Adobe, Aldus, Claris and even Microsoft make what I would call the core
  911. applications. They are core in that between them, they embody most of the
  912. conveniences that makes the Mac a nice platform for doing things on.
  913.     Many of the programmers who write for those products, however, have no
  914. idea what those applications are actually used for. It's a sucker bet in
  915. desktop publishing circles that any new version of an Aldus product will
  916. have crippled it in at least one Absolutely Critical Respect.
  917.  
  918.     The scores of seemingly accidental consistancies that underly Mac apps
  919. are known to those who use them much more than people who write them, by
  920. and large. PageMaker 4 and FreeHand 3 are evidence enough of that.
  921.     To develop Mac applications, you first have to learn to use them.
  922. A good tutor for this is time and the Mac user interface guide from Apple.
  923.  
  924.  
  925. : What is the standard way that application programming is done on the
  926. : Macintosh?  As I mentioned before, my toolbox experience was quite
  927. : hellish because of both the incompatibility of the language with it and
  928. : the fact that there are all these *standard* routines that have to be
  929. : called in the *right* order.  I would like to know how does one avoid
  930. : this nightmare...  surely someone has written a *standard* package that
  931. : will bring this toolbox up to a higher level (usable!).
  932.  
  933.     The Control and Dialog Managers are amazing kludges, aren't they?
  934. That's part of what makes them so very... Well, consistant and modular.
  935. Until IBM and Apple port OS/2 to the Mac, (;^) that's just the way it is.
  936.     I think you are craving an object oriented class library. Whether you
  937. develop one yourself or you get one from the big boys, this sounds as if it
  938. is definitely the choice for you. The higher level you mention comes from
  939. either time and experience, or from a class library. If you are reeking of
  940. sulphur and brimstone this early, you should probably go for one.
  941.  
  942.     By the way, personally, I use Pascal for most early development because
  943. I can read a goofy experimental unit a long time after coding it, whereas I
  944. have some difficulty doing the same with C. If I'm not concerned about the
  945. clarity of a particular routine, screw C altogether, I use machine code.
  946.  
  947.  
  948. : Points of confusion are people mentioning MacApp, MPW, Think C, Think
  949. : Pascal I know that thinkc and think pascal are both compatible with MacApp
  950. : even though MacApp is a MPW module (object oriented).  Should I buy Think C
  951. : and MacApp, or is that not a good combination?
  952.  
  953.     If you were to get Think *, you might not even need MacApp. The Think
  954. products come with the Think Class Library (TCL), in either C or Pascal.
  955. If one were going to compare it and MacApp, it is spartan and yet it seemed
  956. capable of making vanilla applications with relatively little effort. The
  957. documentation is really damn good technical writing, IMHO, and serve to
  958. clarify a great many of the nuances involved in developing even the
  959. simplest apps. The docs are almost better than TCL itself.
  960.     I would suggest this book as a suitable follow up to the Apple user
  961. interface guidelines, since it can reveal the man behind the curtain.
  962.     Of course, I should mention that you can find books like "Writing
  963. Macintosh Applications" and "Macintosh Programming Secrets" and "Using the
  964. Macintosh ToolBox in Pascal" and Knuth's Algorithms and so on ad absurdum
  965. at your friendly neighborhood technical bookstore.
  966.  
  967.  
  968. : Another factor here is cost... I can't afford to spend a grand on MPW,
  969. : Macapp etc!!! I just want to do some programming on the Mac because I
  970. : enjoy the Mac and programming itself.....  Am I out of luck or is there a
  971. : feasable solution?
  972.  
  973.     Who can ignore cost? Your favorite flavor of Think product, including
  974. the hearty Think Class Library and some resourceful customer support is
  975. God's personal gift to you for just $150. Through mail order, your actual
  976. out of pocket expense may plummet earthward. Enjoy, and good luck to you.
  977.  
  978.   Theus (orpheus@reed.edu)
  979.  
  980.  
  981.  
  982.  
  983. ---------------------------
  984.  
  985. From: simon@mmpe.mineral.ualberta.ca (Simon Tortike)
  986. Subject: Think C v5 and Capps' libraries
  987. Organization: University Of Alberta, Edmonton Canada
  988. Date: Wed, 5 Feb 1992 06:06:07 GMT
  989.  
  990. I have been able to use the Capps' editor library PE/APP.p all the
  991. way up to ThinkC v4.0.x, but now find that recompiling my program
  992. under ThinkC v5.0.2 generates a message about the project being incompatable
  993. with this version of Think C.  Is there any option I can use to make
  994. this library work under THinkC v5?  I am running system 7.0.1* in 
  995. 24-bit mode, but with the MODE32 init installed.
  996.  
  997. I should not be surprised if there is no solution, as I had been informed
  998. that the editor library is not 32-bit clean.  Still, I am not running
  999. in 32-bit mode.  It would be nice if Capps' could be re-released as 
  1000. a 32-bit product.  GFor a product that was not updated at least as long as
  1001. I had it (since 1988) it has endured remarkably well, especially given
  1002. that I have generally stayed current in Mac o/s software and in ThinkC.
  1003.  
  1004.    Simon Tortike.
  1005. Regards,
  1006. --
  1007. W. Simon Tortike, Ph.D., P.Eng.     | tel     : 403/492-3338
  1008. Asst. Prof. of Petroleum Engg.      | fax     : 403/492-7219
  1009. Dept of Min-Met-Pet Engg.,          |
  1010. University of Alberta,              | Internet: simon@mmpe.mineral.UAlberta.CA
  1011. Edmonton, AB, CANADA T6G 2G6.       | 
  1012.  
  1013.  
  1014.  
  1015. - -------------------------
  1016.  
  1017. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  1018. Subject:  Think C v5 and Capps' libraries
  1019. Date: 5 Feb 92 19:44:00 GMT
  1020. Organization: Symantec Corp.
  1021.  
  1022. In article <simon.697269967@mmpe.mineral.ualberta.ca> simon@mmpe.mineral.ualberta.ca (Simon Tortike) writes:
  1023.  
  1024.    I have been able to use the Capps' editor library PE/APP.p all the
  1025.    way up to ThinkC v4.0.x, but now find that recompiling my program
  1026.    under ThinkC v5.0.2 generates a message about the project being
  1027.    incompatable with this version of Think C.  Is there any option I
  1028.    can use to make this library work under THinkC v5?
  1029.  
  1030. Try opening up the library (it's a project file) in C 4.0, and then
  1031. closing it. This should update the project to 4.0 format without
  1032. losing the project's contents. You can then use this project as a
  1033. library in C 5.0.
  1034.  
  1035.    I should not be surprised if there is no solution, as I had been
  1036.    informed that the editor library is not 32-bit clean.  Still, I am
  1037.    not running in 32-bit mode.  It would be nice if Capps' could be
  1038.    re-released as a 32-bit product.
  1039.  
  1040. Not only isn't CAPPS' 32-bit clean, it's no longer supported. It was
  1041. officially discontinued about three years ago. If you like, you can
  1042. purchase the sources to CAPPS directly from Symantec (although it's
  1043. expensive).
  1044.  
  1045. A better solution, I think, would be to use a different 3rd party
  1046. editor package, like Word Solution Engine from DataPak software. You
  1047. can reach them at (206) 573-9155. I think that Wolfram Research also
  1048. has an editor toolkit, but I'm not sure.
  1049.  
  1050.     -phil
  1051. --
  1052.    Phil Shapiro                           Technical Support Analyst
  1053.    Language Products Group                     Symantec Corporation
  1054.         Internet: phils@chaos.cs.brandeis.edu
  1055.  
  1056.  
  1057.  
  1058. ---------------------------
  1059.  
  1060. Subject: Logo for the Mac?
  1061. From: rrw@naucse.cse.nau.edu (Robert Wier)
  1062. Date: 5 Feb 92 05:58:03 GMT
  1063. Organization: Northern Arizona University, Flagstaff AZ
  1064.  
  1065.  
  1066.  Hi. I'm not sure if this is the right group for this, but...
  1067.  
  1068.  I'm interested in a shareware/freeware/cheapware version of 
  1069.  LOGO for the Mac -  We are thinking that we'd like to add some
  1070.  SIMPLE programming to our "Introduction to Algorthms" class.
  1071.  LOGO springs to mind for this.  I've searched the net via ARCHIE
  1072.  and have seen LOGO for MSDOS but nothing for the MAC.
  1073.  
  1074.  I'd greatly appreciate any leads on this...
  1075.  
  1076.  THANKS!
  1077.  
  1078.  
  1079.  - Bob Wier
  1080.  
  1081.   ---------- insert favorite standard disclaimers here ----------
  1082.                home of the mc68hc11 mailing list
  1083.          Northern Arizona University / Flagstaff, Arizona
  1084.   Internet: rrw@naucse.cse.nau.edu | BITNET: WIER@NAUVAX | WB5KXH
  1085.                 or   uucp:  ...arizona!naucse!rrw
  1086.         "I get my kicks on Route 66" - really - I live on it
  1087.  
  1088.  
  1089.  
  1090. ---------------------------
  1091.  
  1092. From: dmmg1176@uxa.cso.uiuc.edu (David M Marcovitz)
  1093. Subject: Mac Programming Primer Update for Think C 5.0
  1094. Date: 5 Feb 92 17:51:39 GMT
  1095. Organization: University of Illinois at Urbana
  1096.  
  1097. Recently in this group, I saw updates for the Mac Programming Primer
  1098. on how to change the code to make it compatible with Think C 5.0.
  1099. Unfortunately, my local system has deleted these notes.  Could someone
  1100. please repost them or tell me where I can get them.  Thanks.
  1101.  
  1102.  
  1103. -- 
  1104. David M. Marcovitz                     |  internet: marcovitz@uiuc.edu
  1105. Computer-based Education Research Lab  |            dmmg1176@uxa.cso.uiuc.edu
  1106. University of Illinois                 |  novanet:  marco / cca / nova
  1107.  
  1108.  
  1109.  
  1110. - -------------------------
  1111.  
  1112. From: xxmartn@lims05.lerc.nasa.gov (Jeff Martin)
  1113. Subject:  Mac Programming Primer Update for Think C 5.0
  1114. Date: 5 Feb 92 19:26:00 GMT
  1115. Organization: Electronic Data Systems
  1116.  
  1117. In article <1992Feb5.175139.15806@ux1.cso.uiuc.edu>, dmmg1176@uxa.cso.uiuc.edu (David M Marcovitz) writes...
  1118. >Recently in this group, I saw updates for the Mac Programming Primer
  1119. >on how to change the code to make it compatible with Think C 5.0.
  1120. >Unfortunately, my local system has deleted these notes.  Could someone
  1121. >please repost them or tell me where I can get them.  Thanks.
  1122. >-- 
  1123. >David M. Marcovitz                     |  internet: marcovitz@uiuc.edu
  1124. >Computer-based Education Research Lab  |            dmmg1176@uxa.cso.uiuc.edu
  1125. >University of Illinois                 |  novanet:  marco / cca / nova
  1126.  
  1127. me too please.
  1128.  
  1129. - ---------------
  1130. Please reply to  xxmartn@lims05.lerc.nasa.gov
  1131. - ---------------
  1132.  
  1133.  
  1134.  
  1135. ---------------------------
  1136.  
  1137. From: cmr45797@uxa.cso.uiuc.edu (Charles Mark Remes)
  1138. Subject: pascal source to look at
  1139. Date: 5 Feb 92 20:24:35 GMT
  1140. Organization: University of Illinois at Urbana
  1141.  
  1142.  
  1143.     I've raided all the programming directories at the popular
  1144. FTP sites (sumex and rascal) and downloaded all the source code
  1145. that I could find.  I'm a firm believer in learning by example, but
  1146. the problem is that there isn't much out there ( that I have found).
  1147. Can someone help me out in finding more pascal source examples?
  1148. None of the source I downloaded uses many TextEdit calls, and
  1149. examples of offscreen drawing are not to be found.  Perhaps some
  1150. kind folks on the net would care to share some of their brilliant
  1151. pascal source with us novices so that we may learn.  The easy
  1152. stuff is simple to wring out of Inside Mac, but some of the more
  1153. complex things that programmers may want to do (like me) take a bit
  1154. more experience (of which I am, at the moment, lacking).
  1155.  
  1156. So, if anyone has code they'd like to share please post it on one
  1157. of the ftp sites (so everyone can benefit), or email it to me at
  1158. cmr45797@uxa.cso.uiuc.edu
  1159.  
  1160. Thanks.
  1161.  
  1162. -- 
  1163. _____________________________________________________________________
  1164. * Chuck Remes                 * "When Duty whispers 'You must,'     *  
  1165. * cmr45797@uxa.cso.uiuc.edu   *  Youth replies, 'I can.'"           *
  1166. _____________________________________________________________________
  1167.  
  1168.  
  1169.  
  1170. - -------------------------
  1171.  
  1172. From: CXT105@psuvm.psu.edu (Christopher Tate)
  1173. Subject:  pascal source to look at
  1174. Date: 5 Feb 92 21:54:50 GMT
  1175. Organization: Penn State University
  1176.  
  1177. For examples of lots of nifty techniques, get the "official" Apple sample
  1178. code from the ftp.apple.com anonymous FTP site.
  1179.  
  1180. (Sorry; I don't remember the exact path to the sample code....)
  1181.  
  1182. - -----
  1183. Christopher Tate     | Cryptogram #20:
  1184. cxt105@psuvm.psu.edu |
  1185. CXT105@PSUVM.BITNET  |  NX GXR VTNNWT KG ROT ZLLZKYM XL EKFZYNM, LXY
  1186. - -------------------|  KR VZHTM ROTV MXUUD ZGN OZYN RX WKUOR.
  1187. Send me the answer!  |
  1188.  
  1189.  
  1190.  
  1191. ---------------------------
  1192.  
  1193. From: rdd@cactus.org (Robert Dorsett)
  1194. Subject: Need routine to convert from double to extended.
  1195. Date: 5 Feb 92 21:38:48 GMT
  1196. Organization: Capital Area Central Texas UNIX Society, Austin, Tx
  1197.  
  1198. I'm looking for a routine to convert a number from THINK C's Universal 12-
  1199. byte double to the SANE 10-byte Extended format.  Any help would be much ap-
  1200. preciated...
  1201.  
  1202.  
  1203.  
  1204.  
  1205. - -
  1206. Robert Dorsett
  1207. Internet: rdd@cactus.org
  1208. UUCP: ...cs.utexas.edu!cactus.org!rdd
  1209.  
  1210.  
  1211.  
  1212. - -------------------------
  1213.  
  1214. From: rdd@cactus.org (Robert Dorsett)
  1215. Subject:  Need routine to convert from double to extended.
  1216. Date: 6 Feb 92 04:21:01 GMT
  1217. Organization: The Capital Area Central Texas Unix Society
  1218.  
  1219. In article <10374@cactus.org> rdd@cactus.org (Robert Dorsett) writes:
  1220. >I'm looking for a routine to convert a number from THINK C's Universal 12-
  1221. >byte double to the SANE 10-byte Extended format.  Any help would be much ap-
  1222. >preciated...
  1223.  
  1224. Never mind.  The THINK documentation, as usual, was worthless, the Think 
  1225. Reference had incorrect info, and the Apple documentation points one to the 
  1226. Apple Numerics Manual (which I had never justified acquiring).  HOWEVER, the 
  1227. SANE.h library under THINK C 5.0 mentions a promising "x96tox80" function,
  1228. which actually seems to do the job pretty nicely, although I'm awaiting
  1229. side-effects.
  1230.  
  1231. So I am now able to use the real object of this exercise, X2Fix, with gleeful 
  1232. abandon...:-)
  1233.  
  1234.  
  1235. >Robert Dorsett
  1236. >Internet: rdd@cactus.org
  1237. >UUCP: ...cs.utexas.edu!cactus.org!rdd
  1238.  
  1239. Ditto.
  1240.  
  1241.  
  1242.  
  1243. ---------------------------
  1244.  
  1245. From: aphelps@vicstoy.UUCP (Austin Phelps)
  1246. Subject: BinHex 4.0
  1247. Date: 5 Feb 92 01:18:13 GMT
  1248. Organization: vicstoy: Public Access Unix, Orlando, FL
  1249.  
  1250. Is there a BinHex program that will work on Unix or does this have to be
  1251. unhexed by a Mac?
  1252.  
  1253. -- 
  1254.     Austin C. Phelps
  1255.          aphelps@vicstoy  Pro-Line aphelps@pro-magic    
  1256.  
  1257. Nothing fancy, only limited to 4 lines.
  1258.  
  1259.  
  1260.  
  1261. - -------------------------
  1262.  
  1263. From: Thad.Humphries@p950.f70.n109.z1.FidoNet.Org (Thad Humphries)
  1264. Subject: BinHex 4.0
  1265. Date: 6 Feb 92 03:45:41 GMT
  1266.  
  1267.  
  1268.  AP> From: aphelps@vicstoy.UUCP (Austin Phelps)
  1269.  AP> Newsgroups: comp.sys.mac.programmer
  1270.  AP> Organization: vicstoy: Public Access Unix, Orlando, FL
  1271.  AP> 
  1272.  AP> Is there a BinHex program that will work on Unix or does this have to be
  1273.  AP> unhexed by a Mac?
  1274.  
  1275. If you're talking to UNIX, I've got two suggestions:  suntar 1.1 reads and writes Sun formatted 3.5in (1.4MB) diskettes. Does tar/bar very well.  There is also a uuencode/uudecode for the Mac.  Check the sumex ftp.
  1276.  
  1277.  * Origin: Quis custodiet ipsos custodes? (1:109/70.950)
  1278.  
  1279.  
  1280.  
  1281. ---------------------------
  1282.  
  1283. From: Romain.Vignes@fifi.univ-lyon1.fr
  1284. Subject: Traps question
  1285. Date: 21 Jan 92 14:45:43 GMT
  1286.  
  1287.  
  1288.     Hi there,
  1289.  
  1290. In several new header files (THINK C 5.0.1), I found the following definition:
  1291.  
  1292.     pascal void myvoid (int param1, int param2 ...) 
  1293.         = {0xADR1,0xADR2,0xADR3}
  1294.            ????????????????????
  1295.  
  1296. I don't know why there is 3 (sometimes 2) traps addresses.
  1297.  
  1298. If somebody could help me ??????????
  1299.  
  1300. Thanks
  1301.  
  1302.                         Romain Vignes
  1303.                         roms@fifi.univ-lyon1.fr
  1304.  
  1305.  
  1306.  
  1307. - -------------------------
  1308.  
  1309. From: bx5x@vax5.cit.cornell.edu
  1310. Subject:  Traps question
  1311. Date: 21 Jan 92 17:49:50 GMT
  1312. Organization: Cornell University
  1313.  
  1314. In article <1992Jan21.144543.6267@fifi.univ-lyon1.fr>,
  1315. Romain.Vignes@fifi.univ-lyon1.fr writes: 
  1316. > In several new header files (THINK C 5.0.1), I found the following definition:
  1317. >     pascal void myvoid (int param1, int param2 ...) 
  1318. >         = {0xADR1,0xADR2,0xADR3}
  1319. >            ????????????????????
  1320. A lot of the time the trap has a dispatch routine selector or something
  1321. similar that must be pushed onto the stack before the trap is called.
  1322. Most likely, the first fex words of hex are the machine code to do this.
  1323. You will probably find that only the last word of hex is the A-line trap
  1324. ( you will know because the first hex digit must be an 'A' ).
  1325.  
  1326. This all depends on which trap it is, of course.
  1327. Hope this helps.
  1328.  
  1329. -- 
  1330.  
  1331. - -(0000000000000000000000000000000000000000000000000000000000000000000000)---
  1332.  ()00   Dave "Rasferet" Blumenthal   <aka>   bx5x@vax5.cit.cornell.edu   00()
  1333. Disclaimer:     | OK, everybody,   | When a hotel owner was asked why he threw
  1334. I'm a student.  | stay in focus.   | some loud arrogant chess masters out of
  1335. I can say what- |  -Rowlf the dog, | his lobby, he said, "There's nothing worse
  1336. ever I want!    | The Muppet Movie | than chessnuts boasting in an open foyer."
  1337. ______________________________________________________________________________
  1338. If it works right the first time, the documentation is wrong.  - Me
  1339. ______________________________________________________________________________
  1340.       ** I'm a .sig virus.  Attach me to your .sig!  Help me spread!  **
  1341.  
  1342.  
  1343.  
  1344. - -------------------------
  1345.  
  1346. From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
  1347. Subject:  Traps question
  1348. Date: 24 Jan 92 01:40:48 GMT
  1349. Organization: MacDTS, Apple Computer
  1350.  
  1351. In article <1992Jan21.144543.6267@fifi.univ-lyon1.fr>, Romain.Vignes@fifi.univ-lyon1.fr writes:
  1352. >     Hi there,
  1353. > In several new header files (THINK C 5.0.1), I found the following definition:
  1354. >     pascal void myvoid (int param1, int param2 ...) 
  1355. >         = {0xADR1,0xADR2,0xADR3}
  1356. >            ????????????????????
  1357.  
  1358. Here's a specific example:
  1359.  
  1360. pascal MenuHandle NewMenu(short menuID,const Str255 menuTitle)
  1361.     = 0xA931; 
  1362.  
  1363. or
  1364.  
  1365. pascal void SFPutFile(Point where,
  1366.                       ConstStr255Param prompt,
  1367.                       ConstStr255Param origName,
  1368.                       DlgHookProcPtr dlgHook,
  1369.                       SFReply *reply)
  1370.     = {0x3F3C,0x0001,0xA9EA}; 
  1371.  
  1372. In hex definitions like this, the values at the end specify certain inline
  1373. values that should be inserted to call the function.  This is created in
  1374. place of calling a function with a JSR.  Often, there is precisely one
  1375. word (2 bytes) of information, as in the NewMenu() definition.  This is
  1376. used for stack-based traps which have a trap devoted exclusively to them.
  1377. The one-word value is the A-trap instruction (starts with $A) which is
  1378. executed to dispatch this trap function.  When there is more than one
  1379. word, there is a little bit of code that must be executed before the
  1380. trap is called; this usually specifies a selector, either in D0 or on
  1381. the stack, which selects which function to perform.  For example, the
  1382. SFPutFile example above disassembles to:
  1383.  
  1384. MOVE.W     #$0001,-(A7)                            | 3F3C 0001
  1385. _Pack3                                ; A9EA       | A9EA
  1386.  
  1387. As you can see, this pushes the value 1 onto the stack, then executes
  1388. the trap _Pack3.  The other standard files are dealt with similarly,
  1389. only the selector used is different; the Pack3 code looks at the
  1390. selector and uses it to decide what code to execute.
  1391.  
  1392. I hope this information helps;
  1393. Tim Dierks
  1394. MacDTS, but I speak for myself
  1395.  
  1396.  
  1397.  
  1398. - -------------------------
  1399.  
  1400. From: keith@Apple.COM (Keith Rollin)
  1401. Subject:  Traps question
  1402. Date: 28 Jan 92 23:12:36 GMT
  1403. Organization: Apple Computer Inc., Cupertino, CA
  1404.  
  1405. In article <1992Jan21.124951.10030@vax5.cit.cornell.edu> bx5x@vax5.cit.cornell.edu writes:
  1406. >In article <1992Jan21.144543.6267@fifi.univ-lyon1.fr>,
  1407. >Romain.Vignes@fifi.univ-lyon1.fr writes: 
  1408. >> In several new header files (THINK C 5.0.1), I found the following definition:
  1409. >> 
  1410. >>     pascal void myvoid (int param1, int param2 ...) 
  1411. >>         = {0xADR1,0xADR2,0xADR3}
  1412. >>            ????????????????????
  1413. >> 
  1414. >A lot of the time the trap has a dispatch routine selector or something
  1415. >similar that must be pushed onto the stack before the trap is called.
  1416. >Most likely, the first fex words of hex are the machine code to do this.
  1417. >You will probably find that only the last word of hex is the A-line trap
  1418. >( you will know because the first hex digit must be an 'A' ).
  1419.  
  1420. Some so-called "traps" really are multiple trap calls. Take HLockHi for
  1421. example (please). The declaration for this function consists of the
  1422. trap for MoveHHi, and then the trap for HLock.
  1423.  
  1424. #pragma parameter HLockHi(__A0)
  1425. pascal void HLockHi(Handle h)
  1426.  = {0xA064,0xA029}; 
  1427.  
  1428. -- 
  1429. - ----------------------------------------------------------------------------
  1430. Keith Rollin           ---            <Taligent .signature under construction>
  1431. Disclaimer: Pretty soon, I really _won't_ be speaking for Apple...
  1432.  
  1433.  
  1434.  
  1435. ---------------------------
  1436.  
  1437. End of C.S.M.P. Digest
  1438. **********************
  1439.